package com.smartview.jboss.spring.dto;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.IdClass;
import javax.persistence.Table;

import net.sf.json.JSONObject;


@Entity @IdClass(LoginDTO.class)
@Table(name = "LOGIN")
public class LoginDTO implements BasicDTO, Serializable {
	
	
	@Column(name = "id")
	@Id private String id;
	@Column(name = "service_code")
	@Id private String service_code;
	@Column(name = "service_id")
	private String service_id;
	@Column(name = "service_pw")
	private String service_pw;

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getService_code() {
		return service_code;
	}

	public void setService_code(String service_code) {
		this.service_code = service_code;
	}

	public String getService_id() {
		return service_id;
	}

	public void setService_id(String service_id) {
		this.service_id = service_id;
	}

	public String getService_pw() {
		return service_pw;
	}

	public void setService_pw(String service_pw) {
		this.service_pw = service_pw;
	}

	public JSONObject toJson()
	{
		JSONObject jObj = new JSONObject();
		jObj.element("id", id);
		jObj.element("service_code", service_code);
		jObj.element("service_id", service_id);
		jObj.element("service_password", service_pw);
	
		
		return jObj;
	}
/*	
	public String toString()
	{
		return "<ID : " + id + ", PASS : " + password + ">";
	}
*/
}
